package data

import (
	"core/corestruct"
	"core/coreutil"
	"ht/htinfo"
	"reflect"
)

type HtPageDto struct {
	Id int64 `json:"id,string"                         gorm:"column:id;primaryKey;comment:主键;autoIncrement:false;"`

	Code     string            `json:"code"         validate:"max=50"   gorm:"column:code;size:50;DEFAULT:'';not null;comment:页面代码;memo:网站Url;"`
	Name     string            `json:"name"         validate:"required,max=50"gorm:"column:name;size:50;DEFAULT:'';not null;comment:页面名称;"`
	Memo     string            `json:"memo"                             gorm:"column:memo;DEFAULT:'';not null;comment:备注;"`
	Imgurl   string            `json:"imgurl"                           gorm:"column:imgurl;DEFAULT:'';not null;comment:图标;"`
	Lx       string            `json:"lx"           validate:"max=10"   gorm:"column:lx;size:10;DEFAULT:'';not null;comment:类型;memo:平台、网站、小程序、终端;"`
	P1       string            `json:"p1"           validate:"max=50"   gorm:"column:p_1;size:50;DEFAULT:'';not null;comment:参数1;"`
	P2       string            `json:"p2"           validate:"max=50"   gorm:"column:p_2;size:50;DEFAULT:'';not null;comment:参数2;"`
	P3       string            `json:"p3"           validate:"max=50"   gorm:"column:p_3;size:50;DEFAULT:'';not null;comment:参数3;"`
	P4       string            `json:"p4"           validate:"max=50"   gorm:"column:p_4;size:50;DEFAULT:'';not null;comment:参数4;"`
	Auths    []HtPageAuthDto   `json:"auths"                            gorm:"-;comment:Auths;"`
	CrtDt    corestruct.MyTime `json:"crtDt"                            gorm:"column:crt_dt;not null;comment:创建日期;"`
	CrtUname string            `json:"crtUname"                         gorm:"column:crt_uname;DEFAULT:'';not null;comment:创建人;"`
	EdtDt    corestruct.MyTime `json:"edtDt"                            gorm:"column:edt_dt;not null;comment:修改日期;"`
	EdtUname string            `json:"edtUname"                         gorm:"column:edt_uname;DEFAULT:'';not null;comment:修改人;"`
}

func (p *HtPageDto) TableName() string {
	return "HtPage"
}
func HtPageDtoInit() {
	var mcls = &HtPageDto{}
	var m = &corestruct.MyClass{
		Name:     "页面Dto",
		Ename:    "",
		FullName: "",
		Memo:     "",
		Fileds:   nil,
		PrjName:  htinfo.PRJ_NAME,
		Type:     reflect.TypeOf(mcls),
	}
	coreutil.StructUtil.AddDto(m)
}
